Skip to content

Conversation

@penalosa
Copy link

@penalosa penalosa commented Nov 19, 2025

Summary

This adds npm user agent sniffing to the package manager detection logic. Previously, package manager detection logic relied on lockfiles, which requires the project to already have been created. Another use case for package manager detection logic is figuring out which package manager ran a creation flow. In that case (e.g. npm create cloudflare vs pnpm create cloudflare) there's no lockfile to go off, and so we need to rely on the user agent.

This copies over logic from Wrangler with the intention of removing it in Wrangler entirely and relying on @netlify/build-info.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

IMG_5387

@penalosa penalosa requested a review from a team as a code owner November 19, 2025 13:01
installCommand: 'pnpm install',
runCommand: 'pnpm run',
localPackageCommand: 'pnpm',
remotePackageCommand: ['pnpm', 'dlx'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about pnpx?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpx was deprecated in pnpm v6, I believe, although it still seems to work as an alias

Copy link
Contributor

@ascorbic ascorbic Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it was un-deprecated. It's no longer documented as such. I guess it's safer to keep as this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants